{%extends 'myadmin/public/base.html' %}
{% block con-header %}
<div class="container-fluid am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
            <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span>会员列表</div>
           
        </div>
        <div class="am-u-lg-3 tpl-index-settings-button">
            <button type="button" class="page-header-button"><span class="am-icon-paint-brush"></span> 设置</button>
        </div>
    </div>

</div>
{%endblock%}



{% block con-body %}
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
               
                <div class="widget-body  am-fr">

                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                               
                            </div>
                        </div>
                    </div>
                    <!-- 条件搜索 -->
                    <form >
                        <div class="am-u-sm-12 am-u-md-6 am-u-lg-3">
                            <div class="am-form-group tpl-table-list-select">
                                <select name="statu" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                                  <option{% if request.GET.statu == '0'  %} selected {% endif  %} value="0" >所有类别</option>
                                  <option{% if request.GET.statu == '1'  %} selected {% endif  %} value="1" >未付款</option>
                                 <option{% if request.GET.statu == '2'  %} selected {% endif  %} value="2" >待发货</option>
                                   <option{% if request.GET.statu == '3'  %} selected {% endif  %} value="3" >已发货</option>

                                </select>
                            </div>
                        </div>
                        <div class="am-u-sm-12 am-u-md-12 am-u-lg-3">
                            <div class="am-input-group am-input-group-sm tpl-form-border-form cl-p">
                                <input type="text" name="" class="am-form-field " value="" >
                                <span class="am-input-group-btn">
                                  <button class="am-btn  am-btn-default am-btn-success tpl-table-list-field am-icon-search"></button>
                                </span>
                            </div>
                        </div>
                    </form>
                    <!-- 展示内容 -->
                <div class="am-u-sm-12">
                    <table width="100%" class="am-table am-table-compact am-table-striped tpl-table-black ">

                    <tbody>
                        {% for i in order %}    
                        <tr class="trHead hidden-xs hidden-sm">
                            <td colspan="4" class="title clearfix">
                              <div class="f-fl">下单时间：<span class="time">{{ i.addtime|date:"Y-m-d H-i-s"  }}</span>订单号：<span class="orderNumber">{{ i.id }}</span>
                              </div>
                            </td>
                        </tr>
                        
                        <tr class="list-box b-l b-r b-b">
                            <td class="list b-r j-iamCart">
                                <div class="cart-wrap j-CartWrap">
                                    <div class="shop j-shop j-amLight">
                                    {%  for ii in i.orderinfo_set.all %}
                                
                                
                                    
                                    <div class="item b-t clearfix j-item j-iamMain">
                                        <a class="productDetail nameWidth col-xs-4 col-sm-4" href="//detail.meizu.com/item/pro7.html" target="_blank">
                                            <img src="{{ ii.gid.pic  }}" style="width:100px;height: 100px" class="f-fl">
                                        </a>
                                        <div class="describe f-fl col-xs-8 col-sm-8">
                                            <div class="vertic clearfix">
                                                <span class="clearfix">
                                                    <a class="productDetail nameWidth" href="#" target="_blank">
                                                        <i>{{ ii.gid.title }}</i> <i class="pro-d"></i>
                                                    </a>
                                                    <p>
                                                    ￥{{ ii.gid.price }} × {{ ii.num }}
                                                    </p>
                                                </span>
                                            </div>
                                        </div>
                                        <input class="orderSn" value="51090244361541573081" type="hidden">
                                        <input class="isCart" value="1" type="hidden">
                                        <input class="orderSnSon" value="21090244361541579081" type="hidden">
                                    </div>
                                        {% endfor %}
                                    </div>
                                </div>
                            </td>

                            <td class="b-r w125 center price b-t hidden-xs hidden-sm">
                                <div class="priceDiv">
                                    {{ i.totalprice }}
                                    
                                </div>
                            </td>
                            <td class="b-r w125 center state b-t hidden-xs hidden-sm">
                                <div class="stateDiv">
                                {% if i.status == 1  %}

                                    <div>待付款<br></div>
                                {% elif i.status == 2  %}
                                    <div>已付款,待发货<br></div>
                                
                                {% elif i.status == 3  %}
                                    <div>已发货,待收货<br></div>  

                                {% elif i.status == 4  %}
                                    <div>已完成<br></div>

                                {% elif i.status == 4  %}
                                    <div>已取消<br></div>      

                                {% endif %}
                                </div>
                            </td>
                            <td class="w125 center opreat b-t hidden-xs hidden-sm">
                                <ul>
                                    <li orderid='{{ i.id }}' class="more">


                                    
                                    <a  href="#" target="_blank" data-toggle="modal" data-target="#myModal" class="info">
                                      查看详情
                                    </a>


                                    </li>
                                    {% if i.status != 3 %}
                                    <li class="more"><a href="{% url 'admin_order_fagoods' i.id  %}" target="_blank">发货</a></li>
                                    {% endif %}
                                </ul>
                            </td>

                        </tr>
                        
                    {% endfor %}    
                    </tbody>
                       
            </table>
        </div>
                    
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(".user_status_save").click(function(){
        val=$(this).val()
        uid=$(this).attr("uid")
        $.get('{%url "admin_user_ajax"%}', {uid:uid,val:val})

    })


</script>
{% endblock %}